package com.gzcsqic.excelapp.controller;

import com.gzcsqic.excelapp.common.R;
import com.gzcsqic.excelapp.service.ParamService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RequestMapping("param")
@RestController
public class ParamController {

    @Resource
    private ParamService paramService;

    @PostMapping("si/add")
    public R addSi(@RequestBody Map<String,String> data){
        System.out.println(data);
        paramService.addSi(data);
        return R.success();
    }
    @PostMapping("si/edit")
    public R editSi(@RequestBody Map<String,String> data){
        System.out.println(data);
        paramService.editSi(data);
        return R.success();
    }
    @PostMapping("si/del")
    public R delSi(@RequestBody Map<String,String> data){
        System.out.println(data);
        paramService.delSi(data);
        return R.success();
    }

    @PostMapping("gr/add")
    public R addGr(@RequestBody Map<String,String> data){
        System.out.println(data);
        paramService.addGr(data);
        return R.success();
    }
    @PostMapping("gr/edit")
    public R editGr(@RequestBody Map<String,String> data){
        System.out.println(data);
        paramService.editGr(data);
        return R.success();
    }
    @PostMapping("gr/del")
    public R delGr(@RequestBody Map<String,String> data){
        System.out.println(data);
        paramService.delGr(data);
        return R.success();
    }

    @PostMapping("test/add")
    public R addTest(@RequestBody Map<String,String> data){
        System.out.println(data);
        paramService.addTest(data);
        return R.success();
    }
    @PostMapping("test/edit")
    public R editTest(@RequestBody Map<String,String> data){
        System.out.println(data);
        paramService.editTest(data);
        return R.success();
    }
    @PostMapping("test/del")
    public R delTest(@RequestBody Map<String,String> data){
        System.out.println(data);
        paramService.delTest(data);
        return R.success();
    }

    @PostMapping("emp/add")
    public R addEmp(@RequestBody Map<String,String> data){
        System.out.println(data);
        paramService.addEmp(data);
        return R.success();
    }
    @PostMapping("emp/edit")
    public R editEmp(@RequestBody Map<String,String> data){
        System.out.println(data);
        paramService.editEmp(data);
        return R.success();
    }
    @PostMapping("emp/del")
    public R delEmp(@RequestBody Map<String,String> data){
        System.out.println(data);
        paramService.delEmp(data);
        return R.success();
    }

}
